package com.cloud.screen.api.controller;

import com.cloud.screen.api.entity.ScreenReqInfo;
import com.cloud.screen.api.service.PunishService;
import com.cloud.screen.common.result.Quokka;
import com.cloud.screen.interfaces.FeignClientSystem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by sl on 2019/6/26.
 */

@RestController
@RequestMapping("screen/api/punish")
public class PunishController {

    @Autowired
    private PunishService punishService;

    /**
     * 案件指数 搜索条件 时间区间 省市 rec_type_id
     * @param start
     * @param end
     * @param regionid
     * @param type 分时 分日 。。
     *  recType  一般 简易
     * @return
     */
    @GetMapping("getLegalCaseInfo")
    public Quokka getLegalCaseInfo(String start ,String end,Long regionid,Integer type,Integer recType){
        return new Quokka(true, punishService.getLegalCaseInfo(start,end,regionid,type,recType));
    }

    /**
     * 问题来源 搜索条件 时间区间、省市
     * @param start
     * @param end
     * @param regionid
     * @return
     */
    @GetMapping("getLegalCaseSource")
    public Quokka getLegalCaseSource(String start ,String end,Long regionid,Integer recType){
        return new Quokka(true, punishService.getLegalCaseSource(start,end,regionid,recType));
    }

    /**
     * 区域分布
     * @param start
     * @param end
     * @param regionid
     * @param recType
     * @return
     */
    @GetMapping("getLegalCaseRegion")
    public Quokka getLegalCaseRegion(String start ,String end,Long regionid,Integer recType){
        return new Quokka(true, punishService.getLegalCaseRegion(start,end,regionid,recType));
    }

    /**
     * top5
     * @param start
     * @param end
     * @param regionid
     * @param recType
     * @return
     */
    @GetMapping("getLegalCaseDomain")
    public Quokka getLegalCaseDomain(String start ,String end,Long regionid,Integer recType){
        return new Quokka(true, punishService.getLegalCaseDomain(start,end,regionid,recType,5));
    }

    /**
     * 首页悬浮栏
     * @param start
     * @param end
     * @return
     */
    @GetMapping("getLegalCaseGeneral")
    public Quokka getLegalCaseGeneral(String start ,String end,Long regionid){
        return new Quokka(true, punishService.getLegalCaseGeneral(start,end,regionid));
    }

    /**
     * 法律法规top5
     * @return
     */
    @GetMapping("getLawCaseTop5")
    public Quokka getLawCaseTop5(String start, String end, Long regionid, Integer recType){
        return new Quokka(true, punishService.getLawCaseTop5(start,end,regionid,recType));
    }

    @GetMapping("getPunishByRegionId")
    public Quokka getPunishByRegionId(ScreenReqInfo info){
        return new Quokka(true, punishService.getPunishByRegionId(info));
    }
}
